# -*- coding = utf-8 -*-
# @Time : 2021/7/15 19:26
# @Author : 龙王赘婿_彪少
# @File : testSqlite.py
# @Software: PyCharm

import sqlite3

conn = sqlite3.connect("test.db")

print("成功打开数据库")

c = conn.cursor()

sql = '''
    create table company
        (id int primary key not null,
        name text not null,
        age int not null,
        address char(50),
        salary real);
'''
# 执行SQL语句
c.execute(sql)

# 提交
conn.commit()
# 关闭
conn.close()

print("成功建表")